package org.gnomus.util;

import com.google.appengine.api.taskqueue.QueueFactory;
import com.google.appengine.api.taskqueue.TaskOptions;
import com.google.apphosting.api.ApiProxy;

public class servlet {

    public static void enqueue(TaskOptions to) {
        com.google.appengine.api.taskqueue.Queue queue = QueueFactory.getDefaultQueue();
        try {
            queue.add(to.method(TaskOptions.Method.GET));
        } catch (ApiProxy.ApiDeadlineExceededException e) {
            System.err.println("WARNING: enqueue(" + to + ") " + e.getMessage());
        } catch (com.google.appengine.api.taskqueue.TransientFailureException e) {
            System.err.println("WARNING: enqueue(" + to + ") " + e.getMessage());
        }
    }
}
